A semantic matching technology has become one of core technologies of natural language processing, and has played an important role in multiple commercial systems, for example, a voice assistant (for example, SIRI or GoogleNow), machine translation, and a chatterbot (for example, MICROSOFT's Xiaoice).
In the prior art, sentences to be matched are divided into multiple word vectors, and each word vector has a fixed quantity of dimensions. Based on this, the sentences to be matched are indicated by linear superposition of word vectors that are included in the sentences. A semantic matching degree between two sentences is described as an inner product between vectors of the two sentences.
In the foregoing manner of semantic matching, sentences are divided into word vectors, but a purpose of dividing the sentences into word vectors is to solve vectors that correspond to entire sentences, and ultimately the semantic matching degree between the two sentences is measured as a whole. In such a manner of sentence integral matching, all information about sentences is indicated by one vector, and impact of matching degrees of partial sentence fragments between sentences on a final semantic matching result is ignored, causing that a matching result is inaccurate.